<?php

Class LoginFacebookForm extends CFormModel
{
	private $identity;
	private $sfacebook;
	public $facebook_id;
	
	public function rules()
	{
		return array(
			array('facebook_id','required'),
		);
	}
	
	public function login()
	{
		$this->identity = new FUserIdentity($this->facebook_id);
		if($this->identity->authenticate()){
			if(Yii::app()->user->login($this->identity)){
				return true;
			}
		}
		return false;
	}
}